#include<bits/stdc++.h>
#define MAX 1010
#define ERROR -1
using namespace std;
class MyStack
{
	private:
		int vals[MAX];
		int top;
	public:
		MyStack()
		{
			top = -1;
		}
		bool pop()
		{
			if(top < 0)
				return false;
			top--;
			return true;
		}
		int getTop()
		{
			if(top < 0)
				return ERROR;
			return vals[top--];
		}
		bool push(int val)
		{
			if(top >= MAX)
				return false;
			vals[++top] = val;
			return true;
		}
};
int main()
{
	MyStack ms;
	ms.push(1);
	cout << ms.getTop() << endl;
	ms.pop();
	cout << ms.getTop() << endl;
	return 0;
}
